package com.bankscene.screenfit.vus;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bankscene.screenfit.R;
import com.bankscene.screenfit.model.Menus;

import org.greenrobot.eventbus.EventBus;

import butterknife.BindView;
import butterknife.ButterKnife;


/**
 * Created by jiiiiiin on 6/14/16.
 */
public class MenusGridViewItemVu extends BaseVu implements Vu {

    @BindView(R.id.icon)
    ImageView icon;
    @BindView(R.id.title)
    TextView title;

    @Override
    public void init(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable EventBus bus) {
        this.bus = bus;
        rootView = inflater.inflate(R.layout.menusgridview_item, container, false);
        unbinder = ButterKnife.bind(this, rootView);
    }

    @Override
    public View getRootView() {
        return rootView;
    }

    public void setVal(@NonNull Menus val) {
        this.icon.setImageResource(val.getIcon());
        this.title.setText(val.getTitle());
    }


    public void setIcon(@NonNull ImageView icon) {
        this.icon = icon;
    }

    public void setTitle(@NonNull TextView title) {
        this.title = title;
    }
}
